<!--
 * Copyright (c) 2015-2025 http://www.hdphp.cn All rights reserved. 
 * Licensed ( http://www.hdphp.cn/licenses/ )
 * Author: Jack <sophia2152@qq.com>
 * 官方网址: http://www.hdphp.cn
 * 这不是一个自由软件！您只能在不用于商业目的的前提下对程序代码进行修改和使用。
 * 任何企业和个人不允许对程序代码以任何形式任何目的再发布。
-->
<template>
  <div>
    <BasicTable @register="registerTable">
      <template #toolbar> </template>
    </BasicTable>
  </div>
</template>
<script lang="ts">
  import { defineComponent } from 'vue';
  import { BasicTable, useTable } from '@/components/Table';
  import { columns, searchFormSchema } from './loginlog.data';

  import { getLoginLogsList } from '@/api/app/system';

  export default defineComponent({
    name: 'SystemLoginLogManagement',
    components: { BasicTable },
    setup() {
      const [registerTable, { reload }] = useTable({
        title: '系统登录日志',
        api: getLoginLogsList,
        columns,
        formConfig: {
          labelWidth: 120,
          schemas: searchFormSchema,
        },
        useSearchForm: true,
        showTableSetting: true,
        bordered: true,
        showIndexColumn: false,
        // afterFetch(e) {
        //   console.log(e, 'jjjj');
        //   return e.map((item: any) => {
        //     item.last_time = item.last_time * 1000;
        //     return item;
        //   });
        // },
        handleSearchInfoFn(info) {
          return info;
        },
      });

      function handleSuccess() {
        reload();
      }

      return {
        registerTable,
        handleSuccess,
      };
    },
  });
</script>
